package strategy;


/**
 * 鸭子抽象类
 */
public abstract class Duck {
    protected final String name;// 名称

    public Duck(String name) {
        this.name = name;
    }

    public void display() {
        System.out.println(name);
    }

    public void quack() {
        System.out.println(name + ":嘎嘎叫~~");
    }

    public void swim() {
        System.out.println(name + ":会游泳~~");
    }

    public void fly() {
        System.out.println(name + ":会飞翔~~~");
    }

}
